package me.firstapp.module.weixin.order;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import me.firstapp.module.base.BaseEntity;

@Entity
@Table(name = "MOBILE_FARE_ORDER")
public class MobileFareOrder extends BaseEntity {

	private static final long serialVersionUID = -7685809641161725925L;

	public static final int STATUS_NOT_PAY = 0;
	public static final int STATUS_PAYED = 1;
	public static final int STATUS_COMPLETE = 2;
	public static final int STATUS_CANCEL = 3;
	public static final String ORDER_NO_START = "M";
	public static final int SETTLE_FLAG_NOT = 0;
	public static final int SETTLE_FLAG_YES = 1;

	// 订单号
	@Column(name = "ORDER_NO", length = 50, unique = true, nullable = false)
	private String orderNo;

	// 微信openId
	@Column(name = "OPEN_ID", length = 40, nullable = false)
	private String openId;

	// 卡号
	@Column(name = "CARD_NO", length = 40, nullable = false)
	private String cardNo;

	// 上级的微信openId
	@Column(name = "CHIEF_OPEN_ID", length = 40, nullable = false)
	private String chiefOpenId;

	// 卡号
	@Column(name = "CHIEF_CARD_NO", length = 40, nullable = false)
	private String chiefCardNo;

	// 话费id
	@Column(name = "MOBILE_FARE_ID", nullable = false)
	private Long mobileFareId;

	// 名称(冗余)
	@Column(name = "NAME", length = 50, nullable = false)
	private String name;

	// 面额
	@Column(name = "VALUE", nullable = false)
	private BigDecimal value;

	// 订单金额
	@Column(name = "AMOUNT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal amount;

	// 支付金额
	@Column(name = "PAY_AMOUNT", columnDefinition = "DECIMAL(11, 4)", nullable = false)
	private BigDecimal payAmount;

	// 订单状态0,未支付;1,已支付;2，已完成；3,已取消；
	@Column(name = "STATUS", columnDefinition = "TINYINT", nullable = false)
	private Integer status;

	// 订单创建时间
	@Column(name = "CREATE_TIME", columnDefinition = "DATETIME", nullable = false)
	private Date createTime;

	// 记账日
	@Column(name = "ACCOUNT_DATE", columnDefinition = "DATE")
	private Date accountDate;

	// 取消时间
	@Column(name = "CANCEL_TIME", columnDefinition = "DATETIME")
	private Date cancelTime;

	// 完成时间
	@Column(name = "COMPLETE_TIME", columnDefinition = "DATETIME")
	private Date completeTime;

	// 备注
	@Column(name = "REMARK", length = 40)
	private String remark;

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		this.orderNo = orderNo;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}

	public BigDecimal getPayAmount() {
		return payAmount;
	}

	public void setPayAmount(BigDecimal payAmount) {
		this.payAmount = payAmount;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getCompleteTime() {
		return completeTime;
	}

	public void setCompleteTime(Date completeTime) {
		this.completeTime = completeTime;
	}

	public Date getCancelTime() {
		return cancelTime;
	}

	public void setCancelTime(Date cancelTime) {
		this.cancelTime = cancelTime;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Date getAccountDate() {
		return accountDate;
	}

	public void setAccountDate(Date accountDate) {
		this.accountDate = accountDate;
	}

	public String getChiefOpenId() {
		return chiefOpenId;
	}

	public void setChiefOpenId(String chiefOpenId) {
		this.chiefOpenId = chiefOpenId;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getChiefCardNo() {
		return chiefCardNo;
	}

	public void setChiefCardNo(String chiefCardNo) {
		this.chiefCardNo = chiefCardNo;
	}

	public Long getMobileFareId() {
		return mobileFareId;
	}

	public void setMobileFareId(Long mobileFareId) {
		this.mobileFareId = mobileFareId;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public BigDecimal getValue() {
		return value;
	}

	public void setValue(BigDecimal value) {
		this.value = value;
	}

}
